﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<CRM.Database.Model.TrainingsRequestsExt>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Новая заявка
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>Новая заявка</h2>
    <% using (Html.BeginForm("TrainingsPlannedRequestCreatePartial"))
       { %>
    <%: Html.ValidationSummary(true) %>
    <%:Html.Hidden("Request.IdTrainingsRequest")%>
    <%:Html.Hidden("Request.IdTrainingsSchedule")%>
    <%:Html.Hidden("Request.IdCustomer")%>
    <%:Html.Hidden("Request.IdContact")%>
    <%:Html.Hidden("Request.IdLegalEntity")%>
    <%:Html.Hidden("Key")%>
    

    <%:Html.DevExpress().Label(
              settings =>
                  {
                      settings.ControlStyle.CssClass = "lable";
                      settings.Text = "Выбранное расписание";
                      settings.Width = 500;
                  }).GetHtml() %>
    <%:Html.Action("TrainingsPlannedRequestSchedulePartial", new {key = Model.Key}) %>

    <%
        if(!Model.IsWebinar)
        {
            Html.DevExpress().Label(settings =>
            {
                settings.ControlStyle.CssClass = "lable";
                settings.Text = "Участники";
                settings.Width = 500;
            }).GetHtml();
        } 
    %>
    <%
        if(!Model.IsWebinar)
        {
            Html.RenderPartial("TrainingsParticipantsPartial");
        }
    %>
    
    <br />

    <table>
        <tr>
            <td>
                    <%:Html.DevExpress().Label(settings =>
                          {
                              settings.ControlStyle.CssClass = "lable";
                              settings.Text = "Название компании";
                              settings.Width = 246;
                          }).GetHtml() %>
                    <%:Html.DevExpress().TextBox( settings => 
                        {
                            settings.Name = "Request.Company";
                            settings.Width = 246;
                            settings.ReadOnly = true;
                            //settings.Properties.NullText = "Введите название компании...";
                        }).Bind(Model.Request.Company).GetHtml()%>
            </td>
            <td>
                 <%:Html.DevExpress().Label(settings =>
                  {
                      settings.ControlStyle.CssClass = "lable";
                      settings.Text = "Контактное лицо";
                      settings.Width = 246;
                  }).GetHtml() %>
                 <%:Html.DevExpress().TextBox( settings => 
                    {
                        settings.Name = "Request.ContactName";
                        settings.Width = 246;
                        settings.ReadOnly = true;
                        //settings.Properties.NullText = "Введите имя контактного лица...";
                    }).Bind(Model.Request.ContactName).GetHtml()%>
            </td>
        </tr>
        <tr>
            <td>
                 <%:Html.DevExpress().Label(settings =>
                  {
                      settings.ControlStyle.CssClass = "lable";
                      settings.Text = "Контактный телефон";
                      settings.Width = 246;
                  }).GetHtml() %>
                <%:Html.DevExpress().TextBox( settings => 
                    {
                        settings.Name = "Request.ContactPhone";
                        settings.Width = 246;
                        settings.ReadOnly = true;
                        //settings.Properties.MaskSettings.Mask = "+7 (999) 000-00-00";
                        //settings.Properties.MaskSettings.IncludeLiterals = MaskIncludeLiteralsMode.None;
                    }).Bind(Model.Request.ContactPhone).GetHtml()%>
            </td>
            <td>
                <%:Html.DevExpress().Label(settings =>
                  {
                      settings.ControlStyle.CssClass = "lable";
                      settings.Text = "Адрес электронной почты";
                      settings.Width = 246;
                      
                  }).GetHtml() %>
                 <%:Html.DevExpress().TextBox( settings => 
                    {
                        settings.Name = "Request.ContactEmail";
                        settings.Width = 246;
                        //settings.Properties.NullText = "Введите адрес электронной почты";
                        settings.ReadOnly = true;
                    }).Bind(Model.Request.ContactEmail).GetHtml()%>
            </td>
        </tr>
    </table>
    
    <br />
    <%:Html.DevExpress().Label(
              settings =>
                  {
                      settings.ControlStyle.CssClass = "lable";
                      settings.Text = "Комментарии";
                      settings.Width = 500;
                  }).GetHtml() %>
    <%:Html.DevExpress().TextBox( settings => 
    //Html.DevExpress().Memo( settings => 
                    {
                        settings.Name = "Request.Comments";
                        settings.Width = 500;
                        //settings.Height = 200;
                        //settings.Properties.NullText = "Комментарии...";
                    }).Bind(Model.Request.Comments).GetHtml()%>
    
    <br />
    <button type="submit" value="Создать заявку">Подать заявку</button>
    <% } %>
</asp:Content>
